import React, { Component } from 'react'

export default class list extends Component {
    render() {
        const { state } = this.props
        return (
           
            <div className="row">
                {
                    
                    state.isFirst ? <h3>请输入查询关键字，点击按钮查询！</h3> : 
                    state.isLoading ? <h3>Loading......</h3> :
                    state.isErorrMessage.isAxiosError ? <h3 style={{color:'red'}}>请求错误！</h3> :
                    this.props.users.map((user) => {
                        const {login,avatar_url,html_url,id} = user
                        return (
                            <div className="card" key={id}>
                            <a href={html_url} target="_blank">
                                <img src={avatar_url} style={{width:'100px'}} />
                            </a>
                            <p className="card-text">{login}</p>
                        </div>
                        )
                    })
                }
               
            </div>
        )
    }
}
